<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <caption>用户列表</caption>
    <tr>
        <th>id</th><th>用户名</th>
        <th>密码</th><th>昵称</th><th>年龄</th>
    </tr>
    <tr v-for="user in arr">
        <td>{{user.id}}</td>
        <td>{{user.username}}</td>
        <td>{{user.password}}</td>
        <td>{{user.nick}}</td>
        <td>{{user.age}}</td>
    </tr>
</table>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    let vm =new Vue({
        el:"table",
        data:{
            arr:[]
        },
        created:function () {//此方法vue对象创建完之后调用，页面加载完需要做的事儿写在这里
            axios.get("/select").then(function (response) {
                vm.arr=response.data;
            })

        }
    })
</script>
</body>
</html>